package com.novax.ex.activity.provider.service;

import com.novax.ex.activity.infrastructure.entity.RankRule;
import com.novax.ex.common.base.BaseMapper;
import com.novax.ex.common.base.BaseService;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import com.novax.ex.activity.infrastructure.entity.RankSubRule;
import com.novax.ex.activity.infrastructure.mapper.RankSubRuleMapper;

import java.util.List;

/**
 * @Description
 * @Author ChenXi
 * @Date 2023/11/23/15:46
 */
 

@Service
public class RankSubRuleService extends BaseService {

    @Resource
    private RankSubRuleMapper rankSubRuleMapper;

    @Override
    protected BaseMapper getBaseMapper() {
        return rankSubRuleMapper;
    }

    /**
     * @Description: 子活动规则列表
     * @Author: ChenXi
     * @Date:  2023/11/24 10:50
     * @param rankSubId
     * @return: java.lang.Object
     **/
    public List<RankSubRule> subRuleList(Long rankSubId) {
        return rankSubRuleMapper.subRuleList(rankSubId);
    }

    /**
     * @Description: 查询是否已有配置
     * @Author: ChenXi
     * @Date:  2023/11/24 15:10
     * @param rankSubId
     * @param language
     * @return: com.novax.ex.activity.infrastructure.entity.RankRule
     **/
    public RankSubRule findByRankIdAndLanguage(Long rankSubId, String language) {
        return rankSubRuleMapper.findByRankIdAndLanguage(rankSubId, language);
    }

}
